package com.fzg.common.demo.stream;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import lombok.extern.slf4j.Slf4j;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;

/**
 * create by fzg
 * 2022/12/12 10:33
 */

@Slf4j
public class CopyDemo {

    public static void main(String[] args) {
        BufferedInputStream in = FileUtil.getInputStream("C:\\Users\\Asus\\Desktop\\temp\\d.txt");
        BufferedOutputStream out = FileUtil.getOutputStream("C:\\Users\\Asus\\Desktop\\temp\\d1.txt");
        long copySize = IoUtil.copy(in, out, IoUtil.DEFAULT_BUFFER_SIZE);
        log.info("拷贝了{}字",copySize);
    }

}
